﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="keywords" content="jQuery DropDownList, List, ListBox, Popup List, jqxDropDownList, jqxListBox, List Widget, ListBox Widget, DropDownList Widget" /> 
    <meta name="description" content="The jqxListBox widget supports multiple selection. You can enable this functionality by setting the 'multiple' property to true."/>
    <title id='Description'>The jqxListBox widget supports multiple selection. You can enable this functionality by setting the 'multiple' property to true.
    </title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript" src="../../scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
</head>
<body>
    <div id='content'>
        <script type="text/javascript">
            $(document).ready(function () {
                var theme = getTheme();

                var source = [
                    "Affogato",
                    "Americano",
                    "Bicerin",
                    "Breve",
                    "Café Bombón",
                    "Café au lait",
                    "Caffé Corretto",
                    "Café Crema",
                    "Caffé Latte",
                    "Caffé macchiato",
                    "Café mélange",
                    "Coffee milk",
                    "Cafe mocha",
                    "Cappuccino",
                    "Carajillo",
                    "Cortado",
                    "Cuban espresso",
                    "Espresso",
                    "Eiskaffee",
                    "The Flat White",
                    "Frappuccino",
                    "Galao",
                    "Greek frappé coffee",
                    "Iced Coffee﻿",
                    "Indian filter coffee",
                    "Instant coffee",
                    "Irish coffee",
                    "Liqueur coffee"
		        ];

                // Create a jqxListBox
                $("#jqxWidget").jqxListBox({ source: source, multiple: true, width: 200, height: 250, theme: theme });
                // select 3 indexes
                $("#jqxWidget").jqxListBox('selectIndex', 2);
                $("#jqxWidget").jqxListBox('selectIndex', 5);
                $("#jqxWidget").jqxListBox('selectIndex', 7);

                // display selected List Items.
                var displaySelectedItems = function () {
                    var items = $("#jqxWidget").jqxListBox('getSelectedItems');
                    var selection = "Selected Items: ";
                    for (var i = 0; i < items.length; i++) {
                        selection += items[i].label + (i < items.length - 1 ? ", " : "");
                    }
                    $("#selectionLog").text(selection);
                }
                displaySelectedItems();
                $("#jqxWidget").bind('change', function () {
                    displaySelectedItems();
                });
            });
        </script>
        <div id='jqxWidget'>
        </div>
        <div style="margin-top: 30px; font-size: 13px; font-family: Verdana;" id="selectionLog"></div>
    </div>
</body>
</html>
